package com.oz.mapper;

import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oz.entity.RoleEntity;

@Mapper
public interface RoleMapper extends BaseMapper<RoleEntity> {



	@Select("<script>"
			+ "SELECT GROUP_CONCAT(role SEPARATOR ', ') AS role FROM BASIC_ROLE r  LEFT JOIN  USER_ROLE ur  ON ur.role_id = r.id " 
			+ "		<where>"
			+ " 		<if test=' user_id != null and user_id != \"\" '> AND ur.user_id = #{user_id}  </if> "
			+ "		</where>"
			+ "</script>")
	String selectByUserId(Map<String,String> param) ;

}

